local skel = fk.CreateSkill {
  name = "role_exmode_mingtu__lb_xu",
}

Fk:loadTranslationTable {
  ["role_exmode_mingtu__lb_xu"] = "虚",
  [":role_exmode_mingtu__lb_xu"] = "出牌阶段限一次，你可以依次弃置你与一名其他角色各一张牌。",
  ["#role_exmode_mingtu__lb_xu"] = "虚：你可以弃置一张牌，然后弃置一名其他角色一张牌",
  ["#role_exmode_mingtu__lb_xu_choose"] = "虚：请弃置一名其他角色一张牌",
  ["#role_exmode_mingtu__lb_xu_dis"] = "虚：弃置%dest一张牌",
}

skel:addEffect("active", {
  prompt = "#role_exmode_mingtu__lb_xu",
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  target_filter = Util.FalseFunc,
  card_filter = function(self, player, to_select, selected, selected_targets)
    return #selected == 0 and not player:prohibitDiscard(to_select)
  end,
  feasible = function(self, player, selected, selected_cards, card)
    return #selected_cards == 1
  end,
  on_use = function(self, room, skillUseEvent)
    local player = skillUseEvent.from
    room:throwCard(skillUseEvent.cards, skel.name, player)
    local tos = table.filter(room.alive_players, function(to)
      return not to:isNude() and to ~= player
    end)
    if #tos > 0 and player:isAlive() then
      local target = room:askToChoosePlayers(player, {
        targets = tos,
        min_num = 1,
        max_num = 1,
        skill_name = skel.name,
        cancelable = false,
        prompt = "#role_exmode_mingtu__lb_xu_choose",
      })[1]
      local card = room:askToChooseCard(player, {
        target = target,
        flag = "he",
        skill_name = skel.name,
        prompt = "#role_exmode_mingtu__lb_xu_dis::" .. target.id,
      })
      room:throwCard(card, skel.name, target, player)
    end
  end,
})

return skel